N, t = map(int, input().split()) mem = {} def f(N, d): if d == 0: return N == 0 if t*((1<